<template>
  <div></div>
</template>

<script>
import store from '@/store'
import router from '@/router'
import { defineComponent, onMounted } from 'vue'
export default defineComponent({
  name: 'LogoutView',
  setup() {
    const onLogout = () => {
      store
        .dispatch('sys_admin/logout')
        .then(() => {
          router.push({ path: '/login' })
        })
        .catch((error) => {
          console.log('Logout.onLogout()捕捉到的错误：', error)
        })
    }

    onMounted(() => {
      onLogout()
    })
    return {
      onLogout,
    }
  },
})
</script>

<style lang="scss"></style>
